{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "679e9cde-ef11-471f-bd9c-37047858e192",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "参数个数= 3\n",
      "sys.argv[0]=/opt/conda/lib/python3.11/site-packages/ipykernel_launcher.py\n",
      "sys.argv[1]=-f\n",
      "sys.argv[2]=/home/jovyan/.local/share/jupyter/runtime/kernel-18504cb5-2a0d-49cb-835b-8fb7907d7da5.json\n"
     ]
    }
   ],
   "source": [
    "import sys\n",
    "def main(argv):\n",
    "    print('参数个数=',len(sys.argv))\n",
    "    for i in range(len(sys.argv)):\n",
    "        print('sys.argv[{0}]={1}'.format(i, sys.argv[i]))\n",
    "if __name__ == '__main__':\n",
    "    main(sys.argv)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2ad7703d-beeb-4488-982b-748d726a12bc",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
